package com.bootdo.acitvity.listener.message.event;

import com.bootdo.acitvity.listener.message.OrderAggregateRoot;
import com.bootdo.acitvity.listener.message.event.component.EventComponent;
import com.bootdo.acitvity.listener.message.event.orderEvent.OrderEvent;
import com.bootdo.acitvity.listener.message.event.orderEvent.PurchaseOrderTransportEvent;
import com.bootdo.acitvity.listener.message.handle.EventHandle;

public class OrderFactory extends EventComponent{
    public OrderAggregateRoot root;
    public  OrderFactory(OrderAggregateRoot root){
        this.root = root;
    }

    EventHandle eventHandle = new EventHandle<PurchaseOrderTransportEvent>() {
        @Override
        public void handleEvent(OrderEvent orderEvent) {
            PurchaseOrderTransportEvent salesOrderPushedEvent = (PurchaseOrderTransportEvent)orderEvent;

        }

        @Override
        public Class<PurchaseOrderTransportEvent> getEventType() {
            Class<? extends EventHandle<PurchaseOrderTransportEvent>> aClass = this.getClass();
            return PurchaseOrderTransportEvent.class;
        }
    };

    {
        addHandle(eventHandle);
    }
}
